<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script> 
<script> 
function check_type(id,value){
	if(value=="1"){
		var val = "0";
	}else{
		var val="1";
	}
	$.post("index.php?m=advertise&c=ajax_check",{id:id,val:val,pytoken:$('#pytoken').val()},function(data){
		html = "<a href=\"javascript:void(0);\" onClick=\"check_type("+id+","+val+");\" >"+data+"</a>";
		$("#"+id).html(html);
	});
} 
function audall2(status)
{
	var codewebarr="";
	$(".check_all:checked").each(function(){ //由于复选框一般选中的是多个,所以可以循环输出 
		if(codewebarr==""){codewebarr=$(this).val();}else{codewebarr=codewebarr+","+$(this).val();}
	});
	if(codewebarr==""){
		parent.layer.msg("您还未选择任何信息！",2,8);	return false;
	}else{
		$("input[name=jobid]").val(codewebarr);
 		$.layer({
			type : 1,
			title :'批量延期', 
			closeBtn : [0 , true],
			border : [10 , 0.3 , '#000', true],
			area : ['270px','180px'],
			page : {dom :"#infobox2"}
		}); 		
	}
}
$(document).ready(function() {
	$(".preview").hover(function(){  
		var pic_url=$(this).attr('url');
		layer.tips("<img src="+pic_url+" style='max-width:380px'>", this, {
      maxWidth: '380px'
    });
	},function(){layer.closeAll('tips');});  
});

$(document).ready(function(){
	$(".job_name").hover(function(){
		var job_name=$(this).attr('v'); 
		if($.trim(job_name)!=''){
			layer.tips(job_name, this, {guide: 1, style: ['background-color:#5EA7DC; color:#fff;top:-7px', '#5EA7DC']}); 
			$(".xubox_layer").addClass("xubox_tips_border");
		} 
	},function(){
		var job_name=$(this).attr('v'); 
		if($.trim(job_name)!=''){
			layer.closeAll('tips');
		} 
	}); 
})
</script>
<link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" /> 
<link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>
<title>后台管理</title>
</head>
<body class="body_ifm">
<div id="wname"  style="display:none; width:350px; "> 
	<div style="height: 160px;" class="job_box_div">  
	   <div class="job_box_inp">
		<table class="table_form "style="width:100%">
			<tr ><td  class='ui_content_wrap' style="width:300px;">复制(CTRL+C)以下内容并添加到模板中</td></tr> 
			<tr><td><input type="text" name="position" id='copy_url' class="input-text" size='45' style="width:310px;"/></td></tr> 
		</table> 
	   </div>
	</div>
</div> 
<div class="infoboxp"> 
<div class="admin_new_tip">
<a href="javascript:;" class="admin_new_tip_close"></a>
<a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
<div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
<div class="admin_new_tip_list_cont">
<div class="admin_new_tip_list">该页面展示了网站所有的广告管理信息，可对广告管理进行编辑操作。</div>
<div class="admin_new_tip_list">可输入名称关键字进行搜索，也可进行详细的高级搜索。</div>
</div>
</div>

<div class="clear"></div>
<div class="admin_new_search_box"> 
	<form action="index.php" name="myform" method="get">
		<input name="m" value="advertise" type="hidden"/> 
		<div class="admin_new_search_name">搜索类型：</div>
		
		<div class="admin_Filter_text formselect" style="width:280px;"  did='dclass_id'>
			<input type="button" value="{yun:}if $smarty.get.class_id=='1'||$smarty.get.class_id==''{/yun}不限{yun:}else{/yun}{yun:}$nclass[$smarty.get.class_id]{/yun}{yun:}/if{/yun}" class="admin_new_select_banner" style="width:260px;"  id="bclass_id">
			
			<input type="hidden" id='class_id' value="{yun:}$smarty.get.class_id{/yun}" name='class_id'>
			
			<div class="admin_Filter_text_box" style="display:none;width:258px;height:230px;top:29px; overflow:auto; overflow-x:hidden" id='dclass_id'>
				<ul>
					{yun:}foreach from= $class item=adv{/yun}
						<li><a href="javascript:void(0)" onClick="formselect('{yun:}$adv.id{/yun}','class_id','{yun:}$adv.class_name{/yun}')">{yun:}$adv.class_name{/yun}</a></li>
					{yun:}/foreach{/yun} 
				</ul>  
			</div>
		</div>
		
		<input class="admin_Filter_search" placeholder="输入你要搜索的关键字" type="text" name="name"  size="25" style="float:left">
		<input  class="admin_Filter_bth"  type="submit" name="comquestion" value="搜索"/>

		<a  href="javascript:void(0)" onclick="$('.admin_screenlist_box').toggle();"   class="admin_new_search_gj">高级搜索</a>
		<a href="index.php?m=advertise&c=ad_add" class="admin_new_cz_tj"> + 添加广告</a>        
		<a href="javascript:void(0)" onClick="layer_del('','index.php?m=advertise&c=cache_ad')" class="admin_new_cz_tj">更新广告缓存</a>
	</form>

    {yun:}include file="admin/admin_search.htm"{/yun}

</div>
<div class="clear"></div> 

<div class="table-list">
<div class="admin_table_border">
<iframe id="supportiframe"  name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe> 
<form action="" name="myform" method="get" id='myform' target="supportiframe">
    <input type="hidden" value="advertise" name="m">
    <input type="hidden" value="del" name="c">
	<input type="hidden" id="pytoken" name="pytoken" value="{yun:}$pytoken{/yun}">
	<table width="100%">
		<thead>
            <tr class="admin_table_top">
            <th><label for="chkall"><input type="checkbox" id='chkAll'  onclick='CheckAll(this.form)'/></label></th>
            <th align="center">编号</th>
            <th align="left" width="150">广告名称</th>
            <th align="left" width="80">使用范围</th>
            <th align="left" width="200">广告类别</th>
            <th align="center">点击量</th>
            <th align="center">广告图片</th>
            <th align="center">结束时间</th>
            <th align="center">排序</th>
            <th align="center" width="60">调用代码</th>
            <th align="center" width="60">状态</th>
            <th class="admin_table_th_bg" align="center" width="180">操作</th>
			</tr>
		</thead>
		<tbody>
		{yun:}foreach item=v key=key from=$linkrows{/yun}
		<tr align="left"{yun:}if ($key+1)%2=='0'{/yun}class="admin_com_td_bg"{yun:}/if{/yun} id="list{yun:}$v.id{/yun}">
		 <td align="center"><input type="checkbox" value="{yun:}$v.id{/yun}" class="check_all"  name='del[]' onclick='unselectall()' rel="del_chk" /></td>
		 <td align="center">{yun:}$v.id{/yun}</td>
			<td align="left" class="td1"><span>{yun:}$v.ad_name{/yun}</span></td>
			<td align="left">{yun:}$v.d_title{/yun}</td>
			<td align="left" class="ud">{yun:}$v.class_name{/yun}</td>
			<td align="center" class="ud">{yun:}$v.hits{/yun}</td>
			
			<td  align="center" class="ud">{yun:}$v.ad_typename{/yun}</td>
			<td class="ud" align="center">{yun:}$v.time_end{/yun}</td>
			<td class="ud" align="center">{yun:}$v.sort{/yun}</td>
			<td class="ud" align="center"> 
				{yun:}if $v.is_end=='1'{/yun}
					已过期
				{yun:}elseif $v.is_open=='0'{/yun}
					已停用
				{yun:}else{/yun} 
				
				<a href="index.php?m=advertise&c=ad_preview&ad_class={yun:}$v.class_id{/yun}&id={yun:}$v.id{/yun}" class="admin_cz_yl">调用</a>
			{yun:}/if{/yun}			
			</td>
			<td align="center" class="ud" id="{yun:}$v.id{/yun}">
				<a href="javascript:void(0);" onClick="check_type({yun:}$v.id{/yun},{yun:}$v.is_check{/yun});" >
					{yun:}if  $v.is_end=='1'{/yun}
						<font color="red">已过期</font>
					{yun:}else if $v.is_check=="1"{/yun}
						<font color="green">已审核</font>
					{yun:}else{/yun}
						<font color="EE6723">未审核</font>
					{yun:}/if{/yun}
				</a>
			</td>
			<td align="center"> <a href="index.php?m=advertise&c=ad_preview&ad_class={yun:}$v.class_id{/yun}&id={yun:}$v.id{/yun}"class="admin_new_c_bth admin_new_c_bth_yl">预览</a>
			<a href="index.php?m=advertise&c=ad_add&id={yun:}$v.id{/yun}" class="admin_new_c_bth">修改</a> 
			<a href="javascript:void(0)" onClick="layer_del('确定要删除？', 'index.php?m=advertise&c=del_ad&id={yun:}$v.id{/yun}');" class="admin_new_c_bth admin_new_c_bth_sc">删除</a>
			</td>
	  </tr>
	  {yun:}/foreach{/yun}
		<tr>
			<td align="center"><input type="checkbox" id='chkAll2' onclick='CheckAll2(this.form)' /></td>
			<td colspan="11" >
				<label for="chkAll2">全选</label>&nbsp;
				<input type="button" onclick="return really('del[]')" value="删除所选" name="delsub" class="admin_button">
				<input class="admin_button" type="button" name="delsub" value="批量延期" onClick="audall2('0');" />
			</td>
		</tr>
		{yun:}if $total > $config.sy_listnum {/yun}
			<tr>
				{yun:}if $pagenum==1{/yun}
					<td colspan="3"> 从 1 到 {yun:}$config.sy_listnum {/yun} ，总共 {yun:}$total{/yun} 条</td>
				{yun:}else if $pagenum > 1 && $pagenum < $pages{/yun}
					<td colspan="3"> 从 {yun:}($pagenum-1) * $config.sy_listnum + 1{/yun} 到 {yun:}$pagenum * $config.sy_listnum{/yun} ，总共 {yun:}$total{/yun} 条</td>
				{yun:}else if $pagenum == $pages{/yun}
					<td colspan="3"> 从 {yun:}($pagenum-1) * $config.sy_listnum + 1{/yun} 到 {yun:}$total{/yun} ，总共 {yun:}$total{/yun} 条</td>
				{yun:}/if{/yun}
				<td colspan="9" class="digg">{yun:}$pagenav{/yun}</td>
			</tr>
		{yun:}/if{/yun}
	  </tbody>
	</table>
</form>
</div>
</div>
</div>
<div id="infobox2" style="display:none;">
	<div class="" >
	<div class="admin_com_t_box"> 
      <form action="index.php?m=advertise&c=ctime" target="supportiframe" method="post" id="formstatus"> 
			<div class="admin_com_smbox_list"><span class="admin_com_smbox_span">延长时间：</span>
            <input class="admin_com_smbox_text" value="" name="endtime" onKeyUp="this.value=this.value.replace(/[^0-9]/g,'')"> <span class="admin_com_smbox_list_s">天</span>
                </div>
             <div class="admin_com_smbox_opt">
			 <input type="submit" onclick="loadlayer();" value='确认' class="admin_examine_bth">
			 <input type="button" onClick="layer.closeAll();" class="admin_examine_bth_qx" value='取消'></div>
		 <input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}">
        <input name="jobid" value="0" type="hidden"> 
      </form>
    </div>
  </div> 
</div>
</body>
</html>